package com.bugpool.leilema.tc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bugpool.leilema.tc.bean.entity.SysMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @Author wh
 * @Description
 * @Date 2023/3/1 15:35
 * @Version 1.0
 **/
@Mapper
public interface MenuMapper extends BaseMapper<SysMenu> {

    List<SysMenu> selectMenuByRoleId(@Param("roleIds") List<Long> roleIds);


    List<SysMenu> selectMenuTreeAll();

    /**
     * 获取所有权限集合
     * @return
     */
    Set<String> selectPermissionsAll();


    /**
     * 根据角色id 获取权限集合
     * @param roleId
     * @return
     */
    Set<String> selectPermissionsByRole(@Param("roleIds") List<Long> roleIds);


    /**
     * 根据角色id 获取权限树
     * @param roleId
     * @return
     */
    List<SysMenu> selectMenuTreeList(@Param("roleIds") List<Long> roleIds);
}
